﻿using System;
using System.Collections.Generic;
using System.ServiceModel;
using System.ServiceModel.Activation;
using ibba.src.global;
using ibba.src.norisk.Contracts;
using ibba.src.norisk.BusinessLogic;

namespace ibba.src.norisk.ServiceImplementation
{
    [AspNetCompatibilityRequirements(RequirementsMode = System.ServiceModel.Activation.AspNetCompatibilityRequirementsMode.Allowed)]
    [ServiceBehavior(InstanceContextMode = InstanceContextMode.PerSession,
                     ConcurrencyMode = ConcurrencyMode.Multiple)]
    class ComboMotivo : IComboMotivo
    {

        private ComboMotivoBL _comboMotivoBL;

        public ComboMotivo()
        {

            try
            {
                _comboMotivoBL = new ComboMotivoBL();
            }
            catch (Exception ex)
            {
                global.ErrorHandler.LogAndThrowFaultException(ex);
            }

        }


        public List<ibba.src.norisk.Contracts.ComboMotivo> ObterComboMotivo()
        {

            List<ibba.src.norisk.Contracts.ComboMotivo> retorno = null;

            try
            {
                retorno = TranslateComboMotivo.Translate(_comboMotivoBL.ObterComboMotivo());
            }

            catch (Exception ex)
            {
                ErrorHandler.LogAndThrowFaultException(new FaultException(ex.ToString()));
            }

            return (retorno);
        }


    }
}

